UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DlHf0ZAlelHdeo1g1He4h61R/DPcMqnJ1xICPuoZYSs='
WHERE
key_id = 'ad546828fe4a72b8778b0a57dbb59e4db7498694670cae5f073fe9d87e40a538'
AND (
token = 'DlHf0ZAlelHdeo1g1He4h61R/DPcMqnJ1xICPuoZYSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)