UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5Ebn2t5JcFLrhY1Ns5ChxlXrIdkW0i/4c920L4gz3I='
WHERE
key_id = '7b250bee5e432c57241f7b4691d15e9711c0492890b2d1dbfbd7329cdb0863fd'
AND (
token = 'G5Ebn2t5JcFLrhY1Ns5ChxlXrIdkW0i/4c920L4gz3I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)