UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a19w6GFlShQg+oPLI4siwbvtU4D1orgkRB+fYG6CCpI=' 
WHERE 
  key_id = '85d87331609c0ad2f6d0f443179eee304eed97932dad8f4b51da3d0094944fce' 
  AND (
    token = 'a19w6GFlShQg+oPLI4siwbvtU4D1orgkRB+fYG6CCpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033