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