UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xAgtZT3/cjHYgpdzBYrk+paePCjjRO2cjc+562LuBBA=' 
WHERE 
  key_id = '643f1b64d8114500aa686254465523c2f6dfd88094e2902222c7341e06d46890' 
  AND (
    token = 'xAgtZT3/cjHYgpdzBYrk+paePCjjRO2cjc+562LuBBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032