UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ojt9K5AphbnEbGmPXwQI+bpQ7/Xr9QesY8Udx5vV7Ak=' 
WHERE 
  key_id = '10dcf801df37b4141d8f0db90200316c0bd1a0cd391ba04305e448e329dc30c0' 
  AND (
    token = 'ojt9K5AphbnEbGmPXwQI+bpQ7/Xr9QesY8Udx5vV7Ak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033