UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kmSyM4dQqjhcVIQOwyYY+/VRlZlEb+H2XHzBDxHfTus=' 
WHERE 
  key_id = '15421194557cdccbb2858f59662b3299d6f375e19c24dd6eab126e65eafba65d' 
  AND (
    token = 'kmSyM4dQqjhcVIQOwyYY+/VRlZlEb+H2XHzBDxHfTus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017