UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sYix8fvtvI9uoDibieIf+ot1x9ftP1bvHr1M6Kigcvs='
WHERE
key_id = '688b57881162c11b1ceea75fe68fc443cd15a2f39ce8d671014e665c7a7e8a5f'
AND (
token = 'sYix8fvtvI9uoDibieIf+ot1x9ftP1bvHr1M6Kigcvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)