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