UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QPRPdY+Ca8hDwZu+79Q3GtzwMIkfl7ynYBkfMJ2wQcA=' 
WHERE 
  key_id = '41cb05a93545cc665f84848265463a6d2ef736b519515ca085028f16d41fa18a' 
  AND (
    token = 'QPRPdY+Ca8hDwZu+79Q3GtzwMIkfl7ynYBkfMJ2wQcA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034