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