UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c68yMlP03KNXQ7PlIiJRGbi5EzJWwZOYdAZGROiXN2o='
WHERE
key_id = '34ec817ae38ce26ed9a07d3ef3fd334b8322d031b6295782100dd5bce2a2030e'
AND (
token = 'c68yMlP03KNXQ7PlIiJRGbi5EzJWwZOYdAZGROiXN2o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)