UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8AwKRY9FcezHwW79nGUJQUdWveL6DFzJfOoyLkrVgfM='
WHERE
key_id = '340b933d6ab4e30b97f26687715ca5dfcd9de7b6c80c60dfa7064cca1bd0e205'
AND (
token = '8AwKRY9FcezHwW79nGUJQUdWveL6DFzJfOoyLkrVgfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)