UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rHW2nzMjrLnfuNCvrqJ6KBMbmeuQigYGI5bVmlVPh98='
WHERE
key_id = '2a915f4d6efaed023bd54131c3646b03f7249183bc125ed722c597308a28aa57'
AND (
token = 'rHW2nzMjrLnfuNCvrqJ6KBMbmeuQigYGI5bVmlVPh98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)