UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QI5ugMUfKHaB2ysKz1CBpfxUURR5RnvSOWfs3N/ms8s='
WHERE
key_id = '5237acc4ba266124e98e8bb0a5d6f252c4e83c67d64a398d709d9eea3cfaaf0d'
AND (
token = 'QI5ugMUfKHaB2ysKz1CBpfxUURR5RnvSOWfs3N/ms8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)