UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gBTm+IoHicbmcnPPSjiLQN+2qlFW0gbMELrC/nTtj2c='
WHERE
key_id = '65936be4cdf04ec275335f8e23ba90c8841831f6a28823affbd998b4a772e4e4'
AND (
token = 'gBTm+IoHicbmcnPPSjiLQN+2qlFW0gbMELrC/nTtj2c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)