UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'icmcY7p61IQ+y8B+DVZEBSUfFqBKcyZ4E4R8ICVWEwo='
WHERE
key_id = '0daf457bee35d8d9893647c8b7585f4aadce52d09ff580765362557a302bc672'
AND (
token = 'icmcY7p61IQ+y8B+DVZEBSUfFqBKcyZ4E4R8ICVWEwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)