UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M03kOJM/7Ehc8iW13AZ2J8USRUooYGDFixCZ7YzW3yM='
WHERE
key_id = '00237a9c517114da3ab291c15db35e5cc118a96d42f05b043dc5225402d93bb8'
AND (
token = 'M03kOJM/7Ehc8iW13AZ2J8USRUooYGDFixCZ7YzW3yM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)