UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3CN/vQwZcWjdyWPpwB2K3/GHiLGjD8R8XgcXRqNzikU=' 
WHERE 
  key_id = 'f18225d1ed5797a5605e03404578457dc34d3649d855376452bc0ad2759c7c09' 
  AND (
    token = '3CN/vQwZcWjdyWPpwB2K3/GHiLGjD8R8XgcXRqNzikU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054