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