UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H0uGaXtJvNu7qTTDL7TbMXeyB9aKG0UfQe4Y49opQJw='
WHERE
key_id = 'a4a922c145ab97ec251b104be4b5c41dde94676515752fe0ae9ad5ebe7784f45'
AND (
token = 'H0uGaXtJvNu7qTTDL7TbMXeyB9aKG0UfQe4Y49opQJw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)