UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mvs4YPWxEzWCPVYWtBD1bkRognZIbJdCYv8nZMgsoOY=' 
WHERE 
  key_id = 'ec55e787fb4e64dd00d94f6ba00d84923e6770ba7c21b2651a3c083462ca9612' 
  AND (
    token = 'Mvs4YPWxEzWCPVYWtBD1bkRognZIbJdCYv8nZMgsoOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034