UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wHgpfwrxSiTSzVxPWyvC4qUboOz6Fbew5vK9cELeAxs=' 
WHERE 
  key_id = 'ed14a5354457df5b23e965cfdd53d97651ab8fa319a23611514c22f73e1861c1' 
  AND (
    token = 'wHgpfwrxSiTSzVxPWyvC4qUboOz6Fbew5vK9cELeAxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025