UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ijPZ4ZyKE0QWuucT/mF70jPXpAi3gORXNdpMdbSuzNk=' 
WHERE 
  key_id = 'f160a54c54bbf16b8a8aafd46ad4ef2a3410e309f8c86a7dfc2b7bf47ea7579e' 
  AND (
    token = 'ijPZ4ZyKE0QWuucT/mF70jPXpAi3gORXNdpMdbSuzNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019