UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yekm1KvV9IAQKbgJGyKOXYw2YTKIr3i/GlGvWVGUFe8=' 
WHERE 
  key_id = 'f76beebc82d07689cb6a689c8ed7b87b7727691d3f8b52e44b399ca32e629879' 
  AND (
    token = 'yekm1KvV9IAQKbgJGyKOXYw2YTKIr3i/GlGvWVGUFe8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036