UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V7TU6nLwl+jmpvb7JmFOmcmrQ3vRHe31UyOXtOhfbxA=' 
WHERE 
  key_id = 'e699d018fcdb021193198e5cbbc89359d3c7304d88eeaf2f1b6d21267fc71f2d' 
  AND (
    token = 'V7TU6nLwl+jmpvb7JmFOmcmrQ3vRHe31UyOXtOhfbxA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033