UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4d9xdvg86rXLV9bgkVb4Uv4eV3bHhDUvd9lm1kseN+E=' 
WHERE 
  key_id = 'd773a74892ad3a58e4638b3a1a4ea4b546d92cadf91061e2afc31baeeaf1ed80' 
  AND (
    token = '4d9xdvg86rXLV9bgkVb4Uv4eV3bHhDUvd9lm1kseN+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049