UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'G/g5bp4j8cqck9aWLNeKdLXhhCVBhR9x+jpWYj0NSPU=' 
WHERE 
  key_id = '32f8f2722551a339d4d0db43191d96bd9bc4f6ab28342cb2d0dc355c0d6e5c71' 
  AND (
    token = 'G/g5bp4j8cqck9aWLNeKdLXhhCVBhR9x+jpWYj0NSPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039