UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GNf4py4YDPJYEKe8IivJ+ZsnXTAKEaOQSFeypEHLaw8='
WHERE
key_id = 'bc69b3e864c146acdf706be7feeb57ff0469afdc67b1e64bbcb8709a04884919'
AND (
token = 'GNf4py4YDPJYEKe8IivJ+ZsnXTAKEaOQSFeypEHLaw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)