UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qQ5XrY+2cVFRGxweW0OWjUnFsjB429V+lkQgM8mLsjs=' 
WHERE 
  key_id = '9c0b1dd1a67c77b185b4f4ce4d2c888c7c9c0e58668f8f097747b5db11214c93' 
  AND (
    token = 'qQ5XrY+2cVFRGxweW0OWjUnFsjB429V+lkQgM8mLsjs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041