UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g/1nzdZqxaBRBHSLGkAGif+/iP//TLLyHPuludRb+xI=' 
WHERE 
  key_id = '7ace6dcb5779c886bc887d8443a41de6c0be0a0d4222f7dcb9a42abebfd1625e' 
  AND (
    token = 'g/1nzdZqxaBRBHSLGkAGif+/iP//TLLyHPuludRb+xI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034