UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KMVl7ChmftpHMGhfeatIhUEMj3xB/jsLhaEaXf0pVpc='
WHERE
key_id = 'a03bcee8b72c4bea7926eb51d9723f9c9521b518d1cb79f5b865f1a603ed6546'
AND (
token = 'KMVl7ChmftpHMGhfeatIhUEMj3xB/jsLhaEaXf0pVpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)