UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LlfT0puxPmp/RgeWVHttT5gL72fLD9e7DJpy2o2ixas='
WHERE
key_id = '9a7443b9ecb36e6a755f5c0df8894524952c73b67ce978039e2567c970d56343'
AND (
token = 'LlfT0puxPmp/RgeWVHttT5gL72fLD9e7DJpy2o2ixas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)