UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '97TBpy8iBiuZrTEZ+DPdtNN8ORZNswVRgmpxg/y6Yk8='
WHERE
key_id = '6b41c50eb93e9a8bb76a9f874e283891d8a7848f641423aed829dc0d0e6d81e8'
AND (
token = '97TBpy8iBiuZrTEZ+DPdtNN8ORZNswVRgmpxg/y6Yk8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)