UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XoZ0Herit1BWQ437mt/d7GBHGOFTyzZG8SZo9tQMOzE=' 
WHERE 
  key_id = 'ae6cff41fd030a4782657dd9a102222985ca4cb0d78fcc97aed5391239aa77d1' 
  AND (
    token = 'XoZ0Herit1BWQ437mt/d7GBHGOFTyzZG8SZo9tQMOzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037