UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 300,
token = 'NGM1XPt3YdZ0IRjJWLLMzI03oFJbZn5p4T0yVeQK/F0='
WHERE
key_id = '40414d25edffc1d0bd9c83e51fe60c36dd0675b5baacbe7931179317b99b1fe1'
AND (
token = 'NGM1XPt3YdZ0IRjJWLLMzI03oFJbZn5p4T0yVeQK/F0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)