UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zgONEROeuu0+rBajBiUlEeL0PwUu/cCJQJB+Eerp3sw='
WHERE
key_id = '0d492bad6d3467692aed05fc1b862a9ae2a1f5d7c5fedab032dbb2e456ca533c'
AND (
token = 'zgONEROeuu0+rBajBiUlEeL0PwUu/cCJQJB+Eerp3sw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)