UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ltEvzp9azqQHd2ndT6Rqm7EF6Paf78GmgIxxrpukz7A='
WHERE
key_id = '394e20c37c3a6c408ccfa932e7a502aa52184a2b9b8010ef2455a3a7906fc644'
AND (
token = 'ltEvzp9azqQHd2ndT6Rqm7EF6Paf78GmgIxxrpukz7A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)