UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bwIleis4YDTXG/nl1E4g137IKvsO7ccGj/uqBbsGrCc='
WHERE
key_id = 'e9ac0d2715b31efb8983a66e2c650ce2387a2abd08640a3711ef77e48dafebcc'
AND (
token = 'bwIleis4YDTXG/nl1E4g137IKvsO7ccGj/uqBbsGrCc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)