UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ykl9twoiURIZ7odmMmMvk6ZekuCdQiKzXZTxo5gR9W4='
WHERE
key_id = '0bb4d6741b049a37ffb6dc59a4920620d4b9d5038b49917b68ff05835851145c'
AND (
token = 'Ykl9twoiURIZ7odmMmMvk6ZekuCdQiKzXZTxo5gR9W4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)