UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'imGIYVEW9Gb6dwaOQt8qHCSGx3KWHFfuFl2eZGtPxUo='
WHERE
key_id = 'd2e10c056abe6e85d92d0a714e7580622f6b2224ebefa2440ee3b82b77585283'
AND (
token = 'imGIYVEW9Gb6dwaOQt8qHCSGx3KWHFfuFl2eZGtPxUo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)