UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rdh2y32wnPRYtJVGVdddtAHuaL9Z2bB6NCAmW6Kr05Y=' 
WHERE 
  key_id = '5c964f6817d027a7b528c2fe84e4249a6ea6c4d727e311b8ab805cfb0a4aa169' 
  AND (
    token = 'rdh2y32wnPRYtJVGVdddtAHuaL9Z2bB6NCAmW6Kr05Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041