UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NBUtSIfu4m3fXYPyLnGI2XqBiZFFThsVc7JdbT0Qq10='
WHERE
key_id = '80d9737ada9a40bdb3719fd6de0aa5778287df7652d3f2c60a7b85fc5c854781'
AND (
token = 'NBUtSIfu4m3fXYPyLnGI2XqBiZFFThsVc7JdbT0Qq10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)