UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OAkfXTkWEkQXscyGvg53h3RYg5TzJx+DVd7YBvLY9f4='
WHERE
key_id = '97fe3f5ae4917611f09d267ee77dc96e4ac2712509ff490823fd076de139e855'
AND (
token = 'OAkfXTkWEkQXscyGvg53h3RYg5TzJx+DVd7YBvLY9f4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)