UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'de2/saDMTelRGMJDK7fBxF8ebgji8qE4DZTuZ2OrxBs='
WHERE
key_id = 'ce0c85196293f5ec89323039c1c275b1b0fc1cd396787ef7cedb34f393a94b52'
AND (
token = 'de2/saDMTelRGMJDK7fBxF8ebgji8qE4DZTuZ2OrxBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)