UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e1Cx4hF+g7I+AcLaGrsLazkw9p3J8Y31RI8FiQnquU0=' 
WHERE 
  key_id = 'c23ba25715817ac191a20cbef6514ec294bd40fd5afdaa7e6ea73e16e22dcfdb' 
  AND (
    token = 'e1Cx4hF+g7I+AcLaGrsLazkw9p3J8Y31RI8FiQnquU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033